import {messages} from "share/common";
import React from 'react';
import { connect } from 'react-redux';

import { Alert, Table, Checkbox, message, Button, Form, Divider, Tooltip, Icon, Popconfirm, Input} from 'antd';
const FormItem = Form.Item;
import OutItinerary from 'containers/setting/form/form-detail/form-setting/out-itinerary-modal'
import ItineraryPrompt from 'containers/setting/form/form-detail/form-setting/itinerary-prompt'
import formService from 'containers/setting/form/form.service'
import 'styles/setting/form/form-detail.scss'
import menuRoute from "routes/menuRoute";
import errorMessage from 'share/errorMessage';
import ResizeTable from "components/resize-table";
import configUtil from 'containers/setting/form/form-detail/form-setting/travel-config-util'

class TravelItinerarySetting extends React.Component{
  constructor(props){
    super(props);
    this.state = {
      saveLoading: false, //保存的loading
      showOutModal: false, //外部行程的弹框是否展示
      outItineraryList: [], //外部行程数据
      selectedOutIndex: -1, //选中的外部行程index
      columns: [
        { title: messages('setting.key720'/*功能名称*/), dataIndex: 'name', render: (value, record, index) =>{
          return (
            <div style={{display: 'inline-block'}}>
              {record.name}&nbsp;
              {record.key === 'didi' && (
                <Tooltip title={messages('setting.key1996')/*差旅用车、按日期用车、按次用车需要开通企业滴滴；马上用车、接送机/火车需要开通携程用车。*/}>
                  <Icon type="question-circle-o" />
                </Tooltip>
              )}
            </div>
          )
        }},
        { title: messages('setting.key721'/*是否显示*/), dataIndex: 'show'},
        { title: messages('setting.key722'/*是否必填*/), dataIndex: 'required'},
        { title: messages('mcd.fee.budget.code'/*预算费用编码*/), dataIndex: 'code'}
      ],
      data: [],
      controlFieldsFlight: {},
      controlFieldsHotel: {},
      controlFieldsOfflineHotel: {},
      controlFieldsAirline: {},
      controlFieldsUrban: {},
      airlineBudgetExpenseTypeCode: '',
      trainBudgetExpenseTypeCode: '',
      urbanBudgetExpenseTypeCode: '',
      waterBudgetExpenseTypeCode: '',
      offlineHotelBudgetExpenseTypeCode: '',
      controlFieldsWater: {},
      manageType: {},
      controlFieldsTrain: {},
      costCenterCustom: {},
      controlFieldsCar: {},
      controlFieldsDining: {
        "diningScene": {
          "enable": true,
          "show": true,
          "required": true,
          "control": true
        },
        "city": {
          "enable": false,
          "show": false,
          "required": false,
          "control": false
        },
        "date": {
          "enable": true,
          "show": true,
          "required": true,
          "control": true
        },
        "diningRule": {
          "enable": false,
          "show": false,
          "required": true,
          "control": true
        }
      }, //用餐消费
      isDiningShow: false,//是否显示用餐
      disabled: true,
      isTicketShow: '',//是否显示机票行程
      isHotelShow: '',//是否显示酒店
      isOfflineHotelShow: '',//是否显示非TMC酒店
      isAirlineShow: '',//是否显示非TMC机票
      isUrbanShow: '',//是否显示市内交通
      isWaterShow: '',//是否显示水陆客运
      isTrainShow: '',//是否显示火车
      isDidiShow: false,//是否显示滴滴
      isDidiTravel: false,
      isDidiDate: false,
      isDidiCount: false,
      isCtripInstant: false,
      isCtripPickup: false,
      otherTransport: '',//是否显示其他交通
      travelAllowances: '',//是否显示差旅补贴
      travelDeactivatedate: '',// 没用的两个参数，接口调用的时候要用
      travelRemark: '', //是否显示备注行程
      isEditing: false,//是否点击编辑
      promptList: [], //行程提示语的配置
      formManagement: menuRoute.getRouteItem('form-list', 'key'),//点击返回跳转到的页面
    }
  }
  componentWillMount(){
    this.initProperty();
  }
  //处于编辑状态时切换tab相当于点击取消编辑
  componentWillReceiveProps(nextProps) {
    if(nextProps.params.activeKey !== this.props.params.activeKey){
      this.state.isEditing && this.cancelEditing();
    }
  }
  //点击编辑
  editClicked = () => {
    this.setState({
      isEditing: true,
      disabled: false,
    }, () => {
      this.initTable()
    })
  }
  //点击取消编辑
  cancelEditing = () => {
    this.initProperty('cancelEdit');
  }

  //初始化property，以及取消修改的时候还原数据
  //type为cancelEdit操作取消修改的特殊逻辑
  initProperty = (type) => {
    const {propertyList} = this.props;
    const {formOID} = this.props.params;
    let isTicketShow0 = true,
      isHotelShow0 = false,
      isOfflineHotelShow0 = false,
      isAirlineShow0 = false,
      isUrbanShow0 = false,
      isWaterShow0 = false,
      isTrainShow0 = true,
      isDiningShow = false,
      isDidiShow = false, //默认不展示滴滴xingcheng
      isDidiTravel = false, //差旅用车
      isDidiDate = false, //按日期用车
      isDidiCount = false, //按次数用车
      isCtripInstant = false, //马上用车
      isCtripPickup = false, //接送机／火车
      otherTransport0 = true,
      travelAllowances0 = true,
      travelDeactivatedate0 = false,
      travelRemark0 = true,
      outItineraryList = [];
    const { airlineBudgetExpenseTypeCode, trainBudgetExpenseTypeCode, urbanBudgetExpenseTypeCode, waterBudgetExpenseTypeCode, offlineHotelBudgetExpenseTypeCode } = this.props.data;
    let promptList = [];
    propertyList.map(item => {
      if(item.propertyName === 'ca.travel.flight.disabled') {
        isTicketShow0 = (item.propertyValue === 'true' || item.propertyValue === true) ? false : true;
      }
      if(item.propertyName === 'hotel.itinerary.enable'){
        isHotelShow0 = (item.propertyValue === 'true' || item.propertyValue === true) ? true : false;
      }
      if(item.propertyName === 'offline.hotel.itinerary.enable'){
        isOfflineHotelShow0 = (item.propertyValue === 'true' || item.propertyValue === true) ? true : false;
      }
      if(item.propertyName === 'airline.itinerary.enable'){
        isAirlineShow0 = (item.propertyValue === 'true' || item.propertyValue === true) ? true : false;
      }
      if(item.propertyName === 'urban.itinerary.enable'){
        isUrbanShow0 = (item.propertyValue === 'true' || item.propertyValue === true) ? true : false;
      }
      if(item.propertyName === 'water.itinerary.enable'){
        isWaterShow0 = (item.propertyValue === 'true' || item.propertyValue === true) ? true : false;
      }
      if(item.propertyName === 'ca.travel.train.disabled'){
        isTrainShow0 = (item.propertyValue === 'true' || item.propertyValue === true) ? false : true;
      }
      if(item.propertyName === 'ca.travel.other.disabled'){
        otherTransport0 = (item.propertyValue === 'true' || item.propertyValue === true) ? false : true;
      }
      if(item.propertyName === 'travel.allowance.disabled'){
        travelAllowances0 = (item.propertyValue === 'true' || item.propertyValue === true) ? false : true;
      }
      if(item.propertyName === 'ca.travel.deactivatedate.enabled'){
        travelDeactivatedate0 = (item.propertyValue === 'true' || item.propertyValue === true) ? true : false;
      }
      if(item.propertyName === 'ca.travel.remark.disabled'){
        travelRemark0 = (item.propertyValue === 'true' || item.propertyValue === true) ? false : true;
      }
      if(item.propertyName === 'dining.itinerary.enable'){
        isDiningShow = item.propertyValue === 'true' || item.propertyValue === true;
      }
      if(item.propertyName === 'didi.itinerary.enable'){
        isDidiShow = item.propertyValue === 'true' || item.propertyValue === true;
      }
      if(item.propertyName === 'didi.itinerary.enable.types' && item.propertyValue){
        let didiControlFields = JSON.parse(item.propertyValue);
        isDidiTravel = didiControlFields.TRAVEL;
        isDidiDate = didiControlFields.BUSINESS_TRIP_BY_DATE;
        isDidiCount = didiControlFields.BUSINESS_TRIP_BY_TIMES;
        isCtripInstant = didiControlFields.CARQUICK;
        isCtripPickup = didiControlFields.CARPICKUP;
      }
      if(item.propertyName === 'out_itineraries'){
        outItineraryList = item.propertyValue ? JSON.parse(item.propertyValue) : [];
      }
      if(item.propertyName === 'travel.itinerary.tips'){
        promptList = item.propertyValue ? JSON.parse(item.propertyValue) : [];
      }
    });
    if (type === 'cancelEdit') {
      this.setState({
        isEditing: false,
        disabled: true
      });
    }
    console.log('--000----')
    this.setState({
      isTicketShow: JSON.parse(JSON.stringify(isTicketShow0)),
      isHotelShow: JSON.parse(JSON.stringify(isHotelShow0)),
      isOfflineHotelShow: JSON.parse(JSON.stringify(isOfflineHotelShow0)),
      isAirlineShow: JSON.parse(JSON.stringify(isAirlineShow0)),
      isUrbanShow: JSON.parse(JSON.stringify(isUrbanShow0)),
      isWaterShow: JSON.parse(JSON.stringify(isWaterShow0)),
      isTrainShow: JSON.parse(JSON.stringify(isTrainShow0)),
      isDiningShow,
      isDidiShow,
      isDidiTravel,
      isDidiDate,
      isDidiCount,
      isCtripInstant,
      isCtripPickup,
      outItineraryList,
      promptList,
      controlFieldsCar: JSON.parse(JSON.stringify(this.getControlFieldsCar())),
      controlFieldsDining: JSON.parse(JSON.stringify(this.getControlFieldsDining())),
      otherTransport: JSON.parse(JSON.stringify(otherTransport0)),
      travelAllowances: JSON.parse(JSON.stringify(travelAllowances0)),
      travelDeactivatedate: JSON.parse(JSON.stringify(travelDeactivatedate0)),
      travelRemark: JSON.parse(JSON.stringify(travelRemark0)),
      controlFieldsFlight: JSON.parse(JSON.stringify(this.props.data.controlFieldsFlight)),
      controlFieldsHotel: JSON.parse(JSON.stringify(this.props.data.controlFieldsHotel)),
      controlFieldsOfflineHotel: JSON.parse(JSON.stringify(this.props.data.controlFieldsOfflineHotel)),
      controlFieldsAirline: JSON.parse(JSON.stringify(this.props.data.controlFieldsAirline)),
      controlFieldsUrban: JSON.parse(JSON.stringify(this.props.data.controlFieldsUrban)),
      controlFieldsWater: JSON.parse(JSON.stringify(this.props.data.controlFieldsWater)),
      airlineBudgetExpenseTypeCode,
      trainBudgetExpenseTypeCode,
      urbanBudgetExpenseTypeCode,
      waterBudgetExpenseTypeCode,
      offlineHotelBudgetExpenseTypeCode,
      manageType: JSON.parse(JSON.stringify(this.props.data.manageType)),
      controlFieldsTrain: JSON.parse(JSON.stringify(this.props.data.controlFieldsTrain)),
      costCenterCustom: JSON.parse(JSON.stringify(this.props.data.costCenterCustom)),
    }, () => {
      this.initRemark(type);
    });
  };

  //初始化各个行程的备注配置
  initRemark = (type) => {
    let { controlFieldsFlight, controlFieldsTrain, controlFieldsHotel, controlFieldsOfflineHotel, controlFieldsAirline,
      controlFieldsUrban, controlFieldsWater, controlFieldsDining, controlFieldsCar } = this.state;
    this.initRemarkInFields(controlFieldsFlight);
    this.initRemarkInFields(controlFieldsTrain);
    this.initRemarkInFields(controlFieldsHotel);
    this.initRemarkInFields(controlFieldsOfflineHotel);
    this.initRemarkInFields(controlFieldsAirline);
    this.initRemarkInFields(controlFieldsUrban);
    this.initRemarkInFields(controlFieldsWater);
    this.initRemarkInFields(controlFieldsDining);
    this.initRemarkInFields(controlFieldsCar);

    this.setState({
      controlFieldsFlight,
      controlFieldsTrain,
      controlFieldsHotel,
      controlFieldsOfflineHotel,
      controlFieldsAirline,
      controlFieldsUrban,
      controlFieldsWater,
      controlFieldsDining,
      controlFieldsCar
    }, this.initTable(type));
  };

  initRemarkInFields = (fields) => {
    if (!fields.hasOwnProperty('remark')){
      fields.remark = {
        "enable": false,
        "show": true,
        "required": false,
        "control": false
      };
    }
  };

  getControlFieldsCar = () => {
    const { controlFieldsCar: fieldsCar } = this.props.data;
    let controlFieldsCar = configUtil.getCarConfig();
    controlFieldsCar = fieldsCar || controlFieldsCar;
    return controlFieldsCar;
  };

  getControlFieldsDining = () => {
    const { controlFieldsDining: fieldsDining } = this.props.data;
    let { controlFieldsDining } = this.state;
    controlFieldsDining = fieldsDining || controlFieldsDining;
    return controlFieldsDining;
  };

  //渲染表格内容
  initTable = (type) => {
    const { controlFieldsFlight, controlFieldsHotel, controlFieldsOfflineHotel, controlFieldsTrain, disabled, isTicketShow, isHotelShow, isOfflineHotelShow, isTrainShow, travelRemark,
      otherTransport, travelAllowances, isDidiShow, isDidiTravel, isDidiDate, isDidiCount, outItineraryList, isCtripInstant, isCtripPickup,
      isDiningShow, controlFieldsDining, controlFieldsCar, controlFieldsAirline, controlFieldsUrban, controlFieldsWater, isAirlineShow, isUrbanShow, isWaterShow,
      airlineBudgetExpenseTypeCode, trainBudgetExpenseTypeCode, urbanBudgetExpenseTypeCode, waterBudgetExpenseTypeCode, offlineHotelBudgetExpenseTypeCode
    } = this.state;
    const { city, hotelName, star, roomType, hotelType, optionalReason, fromDate, leaveDate, currency, totalPrice, remark} = controlFieldsOfflineHotel;
    const {fromCity, toCity, departureDate, cabin, discount, taxTotalAmount, optionalReasonOfflineAir } = controlFieldsAirline;
    const {taxTotalAmount: taxTotalAmountUrban} = controlFieldsUrban;
    const {fromCity: fromCityWater, toCity: toCityWater, departureDate: departureDateWater, taxTotalAmount: taxTotalAmountWater} = controlFieldsWater;
    const {getFieldDecorator} = this.props.form;
    if(type && type === 'cancelEdit'){
      this.props.form.resetFields();
    }
    let initTableData = [
      {
        name: messages('setting.key723'/*TMC机票行程*/),
        key: 'ticket',
        show:
          <FormItem>
            {getFieldDecorator('ticket', {
              rules: [{
                   required: false,
              }],
              valuePropName: 'checked',
              initialValue: isTicketShow
            })(
              <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'ticket', 'isTicketShow')}/>
            )}
          </FormItem>,
        required: '',
        code: '',
        children: [
          {
            name: messages('setting.key687'/*出发城市*/),
            key: 'fromCities' ,
            show:
              <FormItem>
                {getFieldDecorator('fromCitiesS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.fromCities.show
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('fromCitiesR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.fromCities.required
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'fromCitiesR', 'fromCities', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key688'/*到达城市*/),
            key: 'toCities' ,
            show:
              <FormItem>
                {getFieldDecorator('toCitiesS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.toCities.show
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('toCitiesR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.toCities.required
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'toCitiesR', 'toCities', 'required')}/>
                )}
              </FormItem>,
             },
          {
            name: messages('setting.key689'/*出发日期*/),
            key: 'departBeginDate' ,
            show:
              <FormItem>
                {getFieldDecorator('departBeginDateS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.departBeginDate.show
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('departBeginDateR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.departBeginDate.required
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
             },
          {
            name: messages('setting.key694'/*返程日期*/),
            key: 'returnEndDate' ,
            show:
            <FormItem>
              {getFieldDecorator('returnEndDateS', {
                rules: [{
                     required: false,
                }],
                valuePropName: 'checked',
                initialValue: controlFieldsFlight.returnEndDate.show
              })(
                <Checkbox disabled />
              )}
            </FormItem>,
              required:
            <FormItem>
              {getFieldDecorator('returnEndDateR', {
                rules: [{
                     required: false,
                }],
                valuePropName: 'checked',
                initialValue: controlFieldsFlight.returnEndDate.required
              })(
                <Checkbox disabled />
              )}
            </FormItem>,
           },
          {
            name: messages('setting.key697'/*出发开始时间*/),
            key: 'takeOffBeginTime' ,
            show:
              <FormItem>
                {getFieldDecorator('takeOffBeginTimeS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.takeOffBeginTime.show
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'takeOffBeginTimeS', 'takeOffBeginTime', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('takeOffBeginTimeR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.takeOffBeginTime.required
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'takeOffBeginTimeR', 'takeOffBeginTime', 'required')}/>
                )}
              </FormItem>,
           },
          {
            name: messages('setting.key698'/*出发结束时间*/),
            key: 'takeOffEndTime' ,
            show:
              <FormItem >
                {getFieldDecorator('takeOffEndTimeS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.takeOffEndTime.show
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'takeOffEndTimeS', 'takeOffEndTime', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('takeOffEndTimeR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.takeOffEndTime.required
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'takeOffEndTimeR', 'takeOffEndTime', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key699'/*到达开始时间*/),
            key: 'arrivalBeginTime' ,
            show:
              <FormItem >
                {getFieldDecorator('arrivalBeginTimeS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.arrivalBeginTime.show
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'arrivalBeginTimeS', 'arrivalBeginTime', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('arrivalBeginTimeR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.arrivalBeginTime.required
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'arrivalBeginTimeR', 'arrivalBeginTime', 'required')}/>
                )}
              </FormItem>,
           },
          {
            name: messages('setting.key700'/*到达结束时间*/),
            key: 'arrivalEndTime' ,
            show:
              <FormItem >
                {getFieldDecorator('arrivalEndTimeS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.arrivalEndTime.show
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'arrivalEndTimeS', 'arrivalEndTime', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('arrivalEndTimeR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.arrivalEndTime.required
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'arrivalEndTimeR', 'arrivalEndTime', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key705'/*价格*/),
            key: 'ticketPrice' ,
            show:
              <FormItem >
                {getFieldDecorator('ticketPriceS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.ticketPrice.show
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'ticketPriceS', 'ticketPrice', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('ticketPriceR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.ticketPrice.required
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'ticketPriceR', 'ticketPrice', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key704'/*折扣*/),
            key: 'discount' ,
            show:
              <FormItem >
                {getFieldDecorator('discountS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.discount.show
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'discountS', 'discount', 'show')}/>
                )}
              </FormItem>,
            required:''
          },
          {
            name: messages('setting.key706'/*舱等*/),
            key: 'seatClass' ,
            show:
              <FormItem >
                {getFieldDecorator('seatClassS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.seatClass.show
                })(
                  <Checkbox disabled={disabled} onChange={(e)=>this.onFlightCheckboxChange(e, 'seatClassS', 'seatClass', 'show')}/>
                )}
              </FormItem>,
            required:'',
            },
          {
            name: messages("common.comment")/*备注*/,
            key: 'ticketNote' ,
            show:
              <FormItem >
                {getFieldDecorator('ticketNoteS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: true
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('ticketNoteR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsFlight.remark.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onFlightCheckboxChange(e, 'ticketNoteR', 'remark', 'required')} />
                )}
              </FormItem>
          },
        ]
      },
      {
        name: messages('setting.key725'/*火车行程*/),
        key: 'train' ,
        show:
          <FormItem >
            {getFieldDecorator('train', {
              rules: [{
                required: false,
              }],
              valuePropName: 'checked',
              initialValue: isTrainShow
            })(
              <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'train', 'isTrainShow')}/>
            )}
          </FormItem>,
        required:'',
        code:
          <FormItem>
            {getFieldDecorator('trainFeeCode', {
              rules: [{
                required: false,
              }],
              initialValue: trainBudgetExpenseTypeCode
            })(
              <Input disabled={disabled} onChange={(e) => this.otherInputChange(e, 'trainFeeCode', 'trainBudgetExpenseTypeCode')}/>
            )}
          </FormItem>,
        children: [
          {
            name: messages('setting.key687'/*出发城市*/),
            key: 'fromCityTrain' ,
            show:
              <FormItem>
                {getFieldDecorator('fromCityTrainS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsTrain.fromCity.show
                })(
                  <Checkbox disabled/>
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('fromCityTrainR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsTrain.fromCity.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => {this.onTrainCheckboxChange(e, 'fromCityTrainR', 'fromCity', 'required')}}/>
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key688'/*到达城市*/),
            key: 'toCityTrain' ,
            show:
              <FormItem>
                {getFieldDecorator('toCityTrainS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsTrain.toCity.show
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('toCityTrainR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsTrain.toCity.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => {this.onTrainCheckboxChange(e, 'toCityTrainR', 'toCity', 'required')}}/>
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key689'/*出发日期*/),
            key: 'departBeginDateTrain' ,
            show:
              <FormItem>
                {getFieldDecorator('departBeginDateTrainS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsTrain.departBeginDate.show
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('departBeginDateTrainR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsTrain.departBeginDate.required
                })(
                  <Checkbox disabled/>
                )}
              </FormItem>,
          },
          {
            name: messages('mcd.total.tax.amt'/*含税总金额*/),
            key: 'taxTotalAmountTrain',
            show:
              <FormItem >
                {getFieldDecorator('taxTotalAmountTrainS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsTrain.taxTotalAmount && controlFieldsTrain.taxTotalAmount.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onTrainCheckboxChange(e, 'taxTotalAmountTrainS','taxTotalAmount', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('taxTotalAmountTrainR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsTrain.taxTotalAmount && controlFieldsTrain.taxTotalAmount.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onTrainCheckboxChange(e, 'taxTotalAmountTrainR','taxTotalAmount', 'required')}/>
                )}
              </FormItem>,
          }
        ]
      },
      {
        name: messages('setting.key724'/*TMC酒店行程*/),
        key: 'hotel' ,
        show:
          <FormItem >
            {getFieldDecorator('hotel', {
              rules: [{
                   required: false,
              }],
              valuePropName: 'checked',
              initialValue: isHotelShow
            })(
              <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'hotel', 'isHotelShow')}/>
            )}
          </FormItem>,
        required:'',
        code: '',
        children: [
          {
            name: messages('setting.key708'/*城市*/),
            key: 'cityHotel' ,
            show:
              <FormItem >
                {getFieldDecorator('cityHotelS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsHotel.city && controlFieldsHotel.city.show
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('cityHotelR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsHotel.city && controlFieldsHotel.city.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onHotelCheckboxChange(e, 'cityHotelR','city', 'required')}/>
                )}
              </FormItem>,
            },
          {
            name: messages('setting.key710'/*房间数量*/),
            key: 'roomNumberHotel' ,
            show:
              <FormItem >
                {getFieldDecorator('roomNumberHotelS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsHotel.roomNumber.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onHotelCheckboxChange(e, 'roomNumberHotelS','roomNumber', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('roomNumberHotelR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsHotel.roomNumber.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onHotelCheckboxChange(e, 'roomNumberHotelR','roomNumber', 'required')}/>
                )}
              </FormItem>,
            },
          {
            name: messages('setting.key711'/*单价上限*/),
            key: 'maxPriceHotel' ,
            show:
              <FormItem >
                {getFieldDecorator('maxPriceHotelS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsHotel.maxPrice.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onHotelCheckboxChange(e, 'maxPriceHotelS','maxPrice', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('maxPriceHotelR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsHotel.maxPrice.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onHotelCheckboxChange(e, 'maxPriceHotelR','maxPrice', 'required')}/>
                )}
              </FormItem>,
            },
          {
            name: messages('setting.key712'/*单价下限*/),
            key: 'minPriceHotel' ,
            show:
              <FormItem >
                {getFieldDecorator('minPriceHotelS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsHotel.minPrice.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onHotelCheckboxChange(e, 'minPriceHotelS','minPrice', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('minPriceHotelR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsHotel.minPrice.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onHotelCheckboxChange(e, 'minPriceHotelR','minPrice', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key713'/*入住日期*/),
            key: 'fromDateHotel' ,
            show:
              <FormItem >
                {getFieldDecorator('fromDateHotelS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsHotel.fromDate.show
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('fromDateHotelR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsHotel.fromDate.required
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key715'/*结束日期*/),
            key: 'leaveDateHotel' ,
            show:
              <FormItem >
                {getFieldDecorator('leaveDateHotelR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsHotel.leaveDate.show
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('leaveDateHotelR', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsHotel.leaveDate.required
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
            },
          {
            name: messages("common.comment")/*备注*/,
            key: 'hotelNote' ,
            show:
              <FormItem >
                {getFieldDecorator('hotelNoteS', {
                  rules: [{
                       required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: true
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('hotelNoteR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsHotel.remark.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onHotelCheckboxChange(e, 'hotelNoteR', 'remark', 'required')}/>
                )}
              </FormItem>
          }
        ]
      },
      {
        name: messages('mcd.cus.hotel'/*非TMC酒店行程*/),
        key: 'offlinehotel',
        show:
          <FormItem >
            {getFieldDecorator('offlinehotel', {
              rules: [{
                required: false,
              }],
              valuePropName: 'checked',
              initialValue: isOfflineHotelShow
            })(
              <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'offlinehotel', 'isOfflineHotelShow')}/>
            )}
          </FormItem>,
        required:'',
        code:
          <FormItem>
            {getFieldDecorator('offlineHotelFeeCode', {
              rules: [{
                required: false,
              }],
              initialValue: offlineHotelBudgetExpenseTypeCode
            })(
              <Input disabled={disabled} onChange={(e) => this.otherInputChange(e, 'offlineHotelFeeCode', 'offlineHotelBudgetExpenseTypeCode')}/>
            )}
          </FormItem>,
        children: [
          {
            name: messages('request.key357'/*入住城市*/),
            key: 'cityOfflineHotel',
            show:
              <FormItem >
                {getFieldDecorator('cityOfflineHotelS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: city && city.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'cityOfflineHotelS','city', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('cityOfflineHotelR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: city && city.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'cityOfflineHotelR','city', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('financial-management.key728'/*酒店名称*/),
            key: 'roomNameOfflineHotel' ,
            show:
              <FormItem >
                {getFieldDecorator('roomNameOfflineHotelS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: hotelName && hotelName.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'roomNameOfflineHotelS','hotelName', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('roomNameOfflineHotelR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: hotelName && hotelName.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'roomNameOfflineHotelR','hotelName', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('financial-management.key729'/*星级*/),
            key: 'starOfflineHotel' ,
            show:
              <FormItem >
                {getFieldDecorator('starOfflineHotelS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: star && star.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'starOfflineHotelS', 'star', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('starOfflineHotelR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: star && star.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'starOfflineHotelR', 'star', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('mcd.room.type'/*房型*/),
            key: 'roomTypeOfflineHotel',
            show:
              <FormItem >
                {getFieldDecorator('roomTypeOfflineHotelS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: roomType && roomType.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'roomTypeOfflineHotelS','roomType', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('roomTypeOfflineHotelR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: roomType && roomType.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'roomTypeOfflineHotelR','roomType', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('mcd.hotel.type'/*酒店类型*/),
            key: 'hotelTypeOfflineHotel',
            show:
              <FormItem >
                {getFieldDecorator('hotelTypeOfflineHotelS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: hotelType && hotelType.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'hotelTypeOfflineHotelS','hotelType', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('hotelTypeOfflineHotelR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: hotelType && hotelType.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'hotelTypeOfflineHotelR','hotelType', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('mcd.self.reason'/*自选酒店理由*/),
            key: 'optionalReasonOfflineHotel',
            show:
              <FormItem >
                {getFieldDecorator('optionalReasonOfflineHotelS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: optionalReason && optionalReason.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'optionalReasonOfflineHotelS','optionalReason', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('optionalReasonOfflineHotelR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: optionalReason && optionalReason.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'optionalReasonOfflineHotelR','optionalReason', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key713'/*入住日期*/),
            key: 'fromDateOfflineHotel' ,
            show:
              <FormItem >
                {getFieldDecorator('fromDateOfflineHotelS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: fromDate && fromDate.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'fromDateOfflineHotelS','fromDate', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('fromDateOfflineHotelR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: fromDate && fromDate.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'fromDateOfflineHotelR','fromDate', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key715'/*结束日期*/),
            key: 'leaveDateOfflineHotel',
            show:
              <FormItem >
                {getFieldDecorator('leaveDateOfflineHotelS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: leaveDate && leaveDate.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'leaveDateOfflineHotelS','leaveDate', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('leaveDateOfflineHotelR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: leaveDate && leaveDate.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'leaveDateOfflineHotelR','leaveDate', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('common.currency'/*币种*/),
            key: 'currencyOfflineHotel',
            show:
              <FormItem >
                {getFieldDecorator('currencyOfflineHotelS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: currency && currency.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'currencyOfflineHotelS','currency', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('currencyOfflineHotelR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: currency && currency.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'currencyOfflineHotelR','currency', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('mcd.total.amount'/*总价*/),
            key: 'totalPriceOfflineHotel',
            show:
              <FormItem >
                {getFieldDecorator('totalPriceOfflineHotelS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: totalPrice && totalPrice.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'totalPriceOfflineHotelS','totalPrice', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('totalPriceOfflineHotelR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: totalPrice && totalPrice.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'totalPriceOfflineHotelR','totalPrice', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages("common.comment")/*备注*/,
            key: 'remarkOfflineHotel' ,
            show:
              <FormItem >
                {getFieldDecorator('remarkOfflineHotelS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: remark && remark.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'remarkOfflineHotelS', 'remark', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('remarkOfflineHotelR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: remark && remark.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onOfflineHotelCheckboxChange(e, 'remarkOfflineHotelR', 'remark', 'required')}/>
                )}
              </FormItem>
          }
        ]
      },
      {
        name: messages('mcd.cus.airline'/*非TMC机票*/),
        key: 'airline',
        show:
          <FormItem >
            {getFieldDecorator('airline', {
              rules: [{
                required: false,
              }],
              valuePropName: 'checked',
              initialValue: isAirlineShow
            })(
              <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'airline', 'isAirlineShow')}/>
            )}
          </FormItem>,
        required:'',
        code:
          <FormItem>
            {getFieldDecorator('airlineFeeCode', {
              rules: [{
                required: false,
              }],
              initialValue: airlineBudgetExpenseTypeCode
            })(
              <Input disabled={disabled} onChange={(e) => this.otherInputChange(e, 'airlineFeeCode', 'airlineBudgetExpenseTypeCode')}/>
            )}
          </FormItem>,
        children: [
          {
            name: messages('request.key376'/*出发城市*/),
            key: 'fromCityAirline',
            show:
              <FormItem >
                {getFieldDecorator('fromCityAirlineS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: fromCity && fromCity.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'fromCityAirlineS','fromCity', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('fromCityAirlineR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: fromCity && fromCity.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'fromCityAirlineR','fromCity', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('request.key377'/*达到城市*/),
            key: 'toCityAirline',
            show:
              <FormItem >
                {getFieldDecorator('toCityAirlineS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: toCity && toCity.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'toCityAirlineS','toCity', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('toCityAirlineR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: toCity && toCity.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'toCityAirlineR','toCity', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key689'/*出发日期*/),
            key: 'departureDateAirline',
            show:
              <FormItem >
                {getFieldDecorator('departureDateAirlineS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: departureDate && departureDate.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'departureDateAirlineS', 'departureDate', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('departureDateAirlineR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: departureDate && departureDate.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'departureDateAirlineR', 'departureDate', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('request.key62'/*舱位*/),
            key: 'cabinAirline',
            show:
              <FormItem>
                {getFieldDecorator('cabinAirlineS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: cabin && cabin.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'cabinAirlineS','cabin', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('cabinAirlineR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: cabin && cabin.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'cabinAirlineR','cabin', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('request.key389'/*折扣*/),
            key: 'discountAirline',
            show:
              <FormItem>
                {getFieldDecorator('discountAirlineS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: discount && discount.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'discountAirlineS','discount', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('discountAirlineR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: discount && discount.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'discountAirlineR','discount', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('mcd.total.tax.amt'/*含税总金额*/),
            key: 'taxTotalAmountAirline',
            show:
              <FormItem >
                {getFieldDecorator('taxTotalAmountAirlineS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: taxTotalAmount && taxTotalAmount.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'taxTotalAmountAirlineS','taxTotalAmount', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('taxTotalAmountAirlineR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: taxTotalAmount && taxTotalAmount.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'taxTotalAmountAirlineR','taxTotalAmount', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('mcd.self.flight.reason'/*自选机票理由*/),
            key: 'optionalReason',
            show:
              <FormItem >
                {getFieldDecorator('optionalReasonS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: optionalReasonOfflineAir && optionalReasonOfflineAir.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'optionalReasonS','optionalReasonOfflineAir', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('optionalReasonR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: optionalReasonOfflineAir && optionalReasonOfflineAir.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onAirlineCheckboxChange(e, 'optionalReasonR','optionalReasonOfflineAir', 'required')}/>
                )}
              </FormItem>,
          }
        ]
      },
      {
        name: messages('mcd.cus.city.traffic'/*市内交通*/),
        key: 'urban',
        show:
          <FormItem >
            {getFieldDecorator('urban', {
              rules: [{
                required: false,
              }],
              valuePropName: 'checked',
              initialValue: isUrbanShow
            })(
              <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'urban', 'isUrbanShow')}/>
            )}
          </FormItem>,
        required:'',
        code:
          <FormItem>
            {getFieldDecorator('urbanFeeCode', {
              rules: [{
                required: false,
              }],
              initialValue: urbanBudgetExpenseTypeCode
            })(
              <Input disabled={disabled} onChange={(e) => this.otherInputChange(e, 'urbanFeeCode', 'urbanBudgetExpenseTypeCode')}/>
            )}
          </FormItem>,
        children: [
          {
            name: messages('mcd.total.tax.amt'/*含税总金额*/),
            key: 'taxTotalAmountUrban',
            show:
              <FormItem>
                {getFieldDecorator('taxTotalAmountUrbanS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: taxTotalAmountUrban && taxTotalAmountUrban.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onUrbanCheckboxChange(e, 'taxTotalAmountUrbanS','taxTotalAmount', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('taxTotalAmountUrbanR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: taxTotalAmountUrban && taxTotalAmountUrban.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onUrbanCheckboxChange(e, 'taxTotalAmountUrbanR','taxTotalAmount', 'required')}/>
                )}
              </FormItem>,
          }
        ]
      },
      {
        name: messages('mcd.cus.amphibious'/*水陆客运*/),
        key: 'water',
        show:
          <FormItem >
            {getFieldDecorator('water', {
              rules: [{
                required: false,
              }],
              valuePropName: 'checked',
              initialValue: isWaterShow
            })(
              <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'water', 'isWaterShow')}/>
            )}
          </FormItem>,
        required:'',
        code:
          <FormItem>
            {getFieldDecorator('waterFeeCode', {
              rules: [{
                required: false,
              }],
              initialValue: waterBudgetExpenseTypeCode
            })(
              <Input disabled={disabled} onChange={(e) => this.otherInputChange(e, 'waterFeeCode', 'waterBudgetExpenseTypeCode')}/>
            )}
          </FormItem>,
        children: [
          {
            name: messages('request.key376'/*出发城市*/),
            key: 'fromCityWater',
            show:
              <FormItem >
                {getFieldDecorator('fromCityWaterS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: fromCityWater && fromCityWater.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onWaterCheckboxChange(e, 'fromCityWaterS','fromCity', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('fromCityWaterR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: fromCityWater && fromCityWater.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onWaterCheckboxChange(e, 'fromCityWaterR','fromCity', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('request.key377'/*达到城市*/),
            key: 'toCityWater',
            show:
              <FormItem>
                {getFieldDecorator('toCityWaterS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: toCityWater && toCityWater.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onWaterCheckboxChange(e, 'toCityWaterS','toCity', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('toCityWaterR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: toCityWater && toCityWater.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onWaterCheckboxChange(e, 'toCityWaterR','toCity', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key689'/*出发日期*/),
            key: 'departureDateWater',
            show:
              <FormItem >
                {getFieldDecorator('departureDateWaterS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: departureDateWater && departureDateWater.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onWaterCheckboxChange(e, 'departureDateWaterS', 'departureDate', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('departureDateWateR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: departureDateWater && departureDateWater.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onWaterCheckboxChange(e, 'departureDateWateR', 'departureDate', 'required')}/>
                )}
              </FormItem>,
          },
          {
            name: messages('mcd.total.tax.amt'/*含税总金额*/),
            key: 'taxTotalAmountWater',
            show:
              <FormItem>
                {getFieldDecorator('taxTotalAmountWaterS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: taxTotalAmountWater && taxTotalAmountWater.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onWaterCheckboxChange(e, 'taxTotalAmountWaterS','taxTotalAmount', 'show')}/>
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('taxTotalAmountAirlineR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: taxTotalAmountWater && taxTotalAmountWater.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.onWaterCheckboxChange(e, 'taxTotalAmountWaterR','taxTotalAmount', 'required')}/>
                )}
              </FormItem>,
          }
        ]
      },
      {
        name: messages('setting.key1997')/*用车行程*/,
        key: 'didi',
        show:
          <FormItem >
            {getFieldDecorator('didi', {
              rules: [{
                required: false,
              }],
              valuePropName: 'checked',
              initialValue: isDidiShow
            })(
              <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'didi', 'isDidiShow')}/>
            )}
          </FormItem>,
        required:'',
        code: '',
        children: [
          {
            name: messages('setting.key1491')/*差旅用车*/,
            key: 'didiTravel' ,
            show:
              <FormItem >
                {getFieldDecorator('didiTravel', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: isDidiTravel
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'didiTravel', 'isDidiTravel')}/>
                )}
              </FormItem>,
            required:''
          },
          {
            name: messages('setting.key1492')/*按日期用车*/,
            key: 'didiDate' ,
            show:
              <FormItem >
                {getFieldDecorator('didiDate', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: isDidiDate
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'didiDate', 'isDidiDate')}/>
                )}
              </FormItem>,
            required:'',
            children: [
              {
                name: messages('setting.key2139')/*用车制度*/,
                key: 'businessTripByDateCarRule' ,
                show:
                  <FormItem >
                    {getFieldDecorator('businessTripByDateCarRuleS', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.businessTripByDate.carRule.show
                    })(
                      <Checkbox disabled />
                    )}
                  </FormItem>,
                required:
                  <FormItem >
                    {getFieldDecorator('businessTripByDateCarRuleR', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.businessTripByDate.carRule.required
                    })(
                      <Checkbox disabled />
                    )}
                  </FormItem>
              },
              {
                name: messages('setting.key2140')/*用车日期*/,

                key: 'businessTripByDateStartDate' ,
                show:
                  <FormItem >
                    {getFieldDecorator('businessTripByDateStartDateS', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.businessTripByDate.startDate.show
                    })(
                      <Checkbox disabled />
                    )}
                  </FormItem>,
                required:
                  <FormItem >
                    {getFieldDecorator('businessTripByDateStartDateR', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.businessTripByDate.startDate.required
                    })(
                      <Checkbox disabled />
                    )}
                  </FormItem>
              },
              {
                name: messages('setting.key2141')/*用车城市*/,
                key: 'businessTripByDateDepartureCity' ,
                show:
                  <FormItem >
                    {getFieldDecorator('businessTripByDateDepartureCityS', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.businessTripByDate.departureCity.show
                    })(
                      <Checkbox disabled={disabled} onChange={(e) => {this.onCarCheckboxChange(e, 'businessTripByDateDepartureCityS', 'businessTripByDate', 'departureCity', 'show')}} />
                    )}
                  </FormItem>,
                required:
                  <FormItem >
                    {getFieldDecorator('businessTripByDateDepartureCityR', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.businessTripByDate.departureCity.required
                    })(
                      <Checkbox disabled={disabled} onChange={(e) => {this.onCarCheckboxChange(e, 'businessTripByDateDepartureCityR', 'businessTripByDate', 'departureCity', 'required')}} />
                    )}
                  </FormItem>
              },
              {
                name: messages('setting.key2142')/*用车标准*/,
                key: 'businessTripByDateCarStandard' ,
                show:
                  <FormItem >
                    {getFieldDecorator('businessTripByDateCarStandardS', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.businessTripByDate.carStandard.show
                    })(
                      <Checkbox disabled={disabled} onChange={(e) => {this.onCarCheckboxChange(e, 'businessTripByDateCarStandardS', 'businessTripByDate', 'carStandard', 'show')}} />
                    )}
                  </FormItem>,
                required:
                  <FormItem >
                    {getFieldDecorator('businessTripByDateCarStandardR', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.businessTripByDate.carStandard.required
                    })(
                      <Checkbox disabled={disabled} onChange={(e) => {this.onCarCheckboxChange(e, 'businessTripByDateCarStandardR', 'businessTripByDate', 'carStandard', 'required')}} />
                    )}
                  </FormItem>
              }
            ]
          },
          {
            name: messages('setting.key1493')/*按次数用车*/,
            key: 'didiCount' ,
            show:
              <FormItem >
                {getFieldDecorator('didiCount', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: isDidiCount
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'didiCount', 'isDidiCount')}/>
                )}
              </FormItem>,
            required:''
          },
          {
            name: messages('setting.key1998')/*马上用车*/,
            key: 'ctripInstant' ,
            show:
              <FormItem >
                {getFieldDecorator('ctripInstant', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: isCtripInstant
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'ctripInstant', 'isCtripInstant')}/>
                )}
              </FormItem>,
            required:'',
            children: [
              {
                name: messages('setting.key2141')/*用车城市*/,
                key: 'carQuickDepartureCity' ,
                show:
                  <FormItem >
                    {getFieldDecorator('carQuickDepartureCityS', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.carQuick.departureCity.show
                    })(
                      <Checkbox disabled={disabled} onChange={(e) => {this.onCarCheckboxChange(e, 'carQuickDepartureCityS', 'carQuick', 'departureCity', 'show')}} />
                    )}
                  </FormItem>,
                required:
                  <FormItem >
                    {getFieldDecorator('carQuickDepartureCityR', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.carQuick.departureCity.required
                    })(
                      <Checkbox disabled={disabled} onChange={(e) => {this.onCarCheckboxChange(e, 'carQuickDepartureCityR', 'carQuick', 'departureCity', 'required')}} />
                    )}
                  </FormItem>
              },
              {
                name: messages('setting.key2140')/*用车日期*/,
                key: 'carQuickStartDate' ,
                show:
                  <FormItem >
                    {getFieldDecorator('carQuickStartDateS', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.carQuick.startDate.show
                    })(
                      <Checkbox disabled />
                    )}
                  </FormItem>,
                required:
                  <FormItem >
                    {getFieldDecorator('carQuickStartDateR', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.carQuick.startDate.required
                    })(
                      <Checkbox disabled />
                    )}
                  </FormItem>
              },
              {
                name: messages('setting.key2143')/*用车次数*/,
                key: 'carQuickUseTimes' ,
                show:
                  <FormItem >
                    {getFieldDecorator('carQuickUseTimesS', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.carQuick.useTimes.show
                    })(
                      <Checkbox disabled={disabled} onChange={(e) => {this.onCarCheckboxChange(e, 'carQuickUseTimesS', 'carQuick', 'useTimes', 'show')}} />
                    )}
                  </FormItem>,
                required:
                  <FormItem >
                    {getFieldDecorator('carQuickUseTimesR', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.carQuick.useTimes.required
                    })(
                      <Checkbox disabled={disabled} onChange={(e) => {this.onCarCheckboxChange(e, 'carQuickUseTimesR', 'carQuick', 'useTimes', 'required')}} />
                    )}
                  </FormItem>
              },
              {
                name: messages('setting.key2142')/*用车标准*/,
                key: 'carQuickCarStandard' ,
                show:
                  <FormItem >
                    {getFieldDecorator('carQuickCarStandardS', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.carQuick.carStandard.show
                    })(
                      <Checkbox disabled={disabled} onChange={(e) => {this.onCarCheckboxChange(e, 'carQuickCarStandardS', 'carQuick', 'carStandard', 'show')}} />
                    )}
                  </FormItem>,
                required:
                  <FormItem >
                    {getFieldDecorator('carQuickCarStandardR', {
                      rules: [{
                        required: false,
                      }],
                      valuePropName: 'checked',
                      initialValue: controlFieldsCar.carQuick.carStandard.required
                    })(
                      <Checkbox disabled={disabled} onChange={(e) => {this.onCarCheckboxChange(e, 'carQuickCarStandardR', 'carQuick', 'carStandard', 'required')}} />
                    )}
                  </FormItem>
              }
            ]
          },
          {
            name: messages('setting.key1999')/*接送机／火车*/,
            key: 'ctripPickup' ,
            show:
              <FormItem >
                {getFieldDecorator('ctripPickup', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: isCtripPickup
                })(
                  <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'ctripPickup', 'isCtripPickup')}/>
                )}
              </FormItem>,
            required:''
          },
          {
            name: messages("common.comment")/*备注*/,
            key: 'didiNote' ,
            show:
              <FormItem >
                {getFieldDecorator('didiNoteS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: true
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('didiNoteR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsCar.remark.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => {this.onCarCheckboxChange(e, 'didiNoteR', 'remark', null, 'required')}} />
                )}
              </FormItem>
          }
        ]
      },
      {
        name: messages('setting.key2116')/*用餐消费*/,
        key: 'dining',
        show:
          <FormItem >
            {getFieldDecorator('dining', {
              rules: [{
                required: false,
              }],
              valuePropName: 'checked',
              initialValue: isDiningShow
            })(
              <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'dining', 'isDiningShow')}/>
            )}
          </FormItem>,
        required:'',
        code: '',
        children: [
          {
            name: messages('setting.key2135')/*用餐类型*/,
            key: 'diningScene' ,
            show:
              <FormItem>
                {getFieldDecorator('diningSceneS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsDining.diningScene.show
                })(
                  <Checkbox disabled/>
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('diningSceneR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsDining.diningScene.required
                })(
                  <Checkbox disabled/>
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key708')/*城市*/,
            key: 'cityDining' ,
            show:
              <FormItem>
                {getFieldDecorator('cityDiningS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsDining.city.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => {this.onDiningCheckboxChange(e, 'cityDiningS', 'city', 'show')}}/>
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('cityDiningR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsDining.city.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => {this.onDiningCheckboxChange(e, 'cityDiningR', 'city', 'required')}}/>
                )}
              </FormItem>,
          },
          {
            name: messages('common.date')/*日期*/,
            key: 'dateDining' ,
            show:
              <FormItem>
                {getFieldDecorator('dateDiningS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsDining.date.show
                })(
                  <Checkbox disabled/>
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('dateDiningR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsDining.date.required
                })(
                  <Checkbox disabled/>
                )}
              </FormItem>,
          },
          {
            name: messages('setting.key2118')/*用餐标准*/,
            key: 'diningRule' ,
            show:
              <FormItem>
                {getFieldDecorator('diningRuleS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsDining.diningRule.show
                })(
                  <Checkbox disabled={disabled} onChange={(e) => {this.onDiningCheckboxChange(e, 'diningRuleS', 'diningRule', 'show')}}/>
                )}
              </FormItem>,
            required:
              <FormItem>
                {getFieldDecorator('diningRuleR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsDining.diningRule.required
                })(
                  <Checkbox disabled/>
                )}
              </FormItem>,
          },
          {
            name: messages("common.comment")/*备注*/,
            key: 'diningNote' ,
            show:
              <FormItem >
                {getFieldDecorator('diningNoteS', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: true
                })(
                  <Checkbox disabled />
                )}
              </FormItem>,
            required:
              <FormItem >
                {getFieldDecorator('diningNoteR', {
                  rules: [{
                    required: false,
                  }],
                  valuePropName: 'checked',
                  initialValue: controlFieldsDining.remark.required
                })(
                  <Checkbox disabled={disabled} onChange={(e) => {this.onDiningCheckboxChange(e, 'diningNoteR', 'remark', 'required')}}/>
                )}
              </FormItem>
          }
        ]
      },
      {
        name: messages('setting.key727'/*差旅补贴*/),
        key: 'travelAllowances',
        show:
          <FormItem >
            {getFieldDecorator('travelAllowances', {
              rules: [{
                   required: false,
              }],
              valuePropName: 'checked',
              initialValue: travelAllowances
            })(
              <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'travelAllowances', 'travelAllowances')}/>
            )}
          </FormItem>,
        required: '',
        code: '',
      },
      {
        name: messages("common.comment")/*备注*/,
        key: 'note',
        show:
          <FormItem >
            {getFieldDecorator('note', {
              rules: [{
                   required: false,
              }],
              valuePropName: 'checked',
              initialValue: travelRemark
            })(
              <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'note', 'travelRemark')} />
            )}
          </FormItem>,
        required: '',
        code: '',
      },
      {
        name: messages('setting.key726'/*其他交通*/),
        key: 'otherTransport',
        show:
          <FormItem >
            {getFieldDecorator('otherTransport', {
              rules: [{
                required: false,
              }],
              valuePropName: 'checked',
              initialValue: otherTransport
            })(
              <Checkbox disabled={disabled} onChange={(e) => this.otherCheckboxChange(e, 'otherTransport', 'otherTransport')}/>
            )}
          </FormItem>,
        required: '',
        code: '',
      }
    ];
    outItineraryList.length && outItineraryList.map((out, outIndex) => {
      initTableData.push({
        name: <span>
          <span style={{display: 'inline-block', width: 150, overflow: 'hidden', textOverflow: 'ellipsis'}}>{out.name}</span>
          {!disabled && (<span>
            <span className='default-color-font' style={{display: 'inline-block', cursor: 'pointer', marginLeft: 10, overflow: 'hidden'}}
                  onClick={() => this.showAddOutItinerary(outIndex)}>
              {messages('common.edit')}
            </span>
            <span className='default-color-font' style={{display: 'inline-block', cursor: 'pointer', marginLeft: 10, overflow: 'hidden'}}>
              <Popconfirm title={messages('request.key321'/*你确定删除这行内容吗?*/)}
                          onConfirm={() => this.handleDeleOut(outIndex)}
                          okText={messages('request.key211'/*确定*/)}
                          cancelText={messages('request.key175'/*取消*/)}>
                {messages('common.delete')}
              </Popconfirm>
            </span>
          </span>)}
        </span>,
        key: out.code,
        show: <Checkbox disabled={disabled} checked={out.isShow} onChange={(e) => this.outCheckboxChange(e.target.checked, outIndex)}/>,
        required: '',
      });
    });
    this.setState({
      data: initTableData,
    })
  };
  //点击机票的CheckBox
  onFlightCheckboxChange = (e, key, prop, boolean) => {
   const {controlFieldsFlight} = this.state;
   controlFieldsFlight[prop][boolean] = !this.props.form.getFieldValue(key);
   this.setState({
     controlFieldsFlight
   }, this.initTable);
  };

  //点击酒店的CheckBox
  onHotelCheckboxChange = (e, key, prop, boolean) => {
    const {controlFieldsHotel} = this.state;
    if (!controlFieldsHotel[prop]) {
      controlFieldsHotel[prop] = {};
    }
    controlFieldsHotel[prop][boolean] = !this.props.form.getFieldValue(key);
    this.setState({
      controlFieldsHotel,
    }, this.initTable);
  };

  //点击非TMC酒店的CheckBox
  onOfflineHotelCheckboxChange = (e, key, prop, boolean) => {
    const {controlFieldsOfflineHotel} = this.state;
    if (!controlFieldsOfflineHotel[prop]) {
      controlFieldsOfflineHotel[prop] = {};
    }
    controlFieldsOfflineHotel[prop][boolean] = !this.props.form.getFieldValue(key);
    this.setState({
      controlFieldsOfflineHotel,
    }, this.initTable);
  };

  //点击非TMC机票的CheckBox
  onAirlineCheckboxChange = (e, key, prop, boolean) => {
    const {controlFieldsAirline} = this.state;
    if (!controlFieldsAirline[prop]) {
      controlFieldsAirline[prop] = {};
    }
    controlFieldsAirline[prop][boolean] = !this.props.form.getFieldValue(key);
    this.setState({
      controlFieldsAirline,
    }, this.initTable);
  };

  //点击市内交通的CheckBox
  onUrbanCheckboxChange = (e, key, prop, boolean) => {
    const {controlFieldsUrban} = this.state;
    if (!controlFieldsUrban[prop]) {
      controlFieldsUrban[prop] = {};
    }
    controlFieldsUrban[prop][boolean] = !this.props.form.getFieldValue(key);
    this.setState({
      controlFieldsUrban,
    }, this.initTable);
  };

  //点击水陆客运的CheckBox
  onWaterCheckboxChange = (e, key, prop, boolean) => {
    const {controlFieldsWater} = this.state;
    if (!controlFieldsWater[prop]) {
      controlFieldsWater[prop] = {};
    }
    controlFieldsWater[prop][boolean] = !this.props.form.getFieldValue(key);
    this.setState({
      controlFieldsWater,
    }, this.initTable);
  };

  //点击火车的CheckBox
  onTrainCheckboxChange = (e, key, prop, boolean) => {
    const {controlFieldsTrain} = this.state;
    if(!controlFieldsTrain[prop]) {
      controlFieldsTrain[prop] = {};
    }
    controlFieldsTrain[prop][boolean] = !this.props.form.getFieldValue(key);
    this.setState({
      controlFieldsTrain,
    }, this.initTable);
  };
  //点击用餐的CheckBox
  onDiningCheckboxChange = (e, key, prop, boolean) => {
    const { controlFieldsDining } = this.state;
    controlFieldsDining[prop][boolean] = !this.props.form.getFieldValue(key);
    this.setState({
      controlFieldsDining
    }, this.initTable);
  };
  //点击用车的CheckBox
  onCarCheckboxChange = (e, key, type, prop, boolean) => {
    const { controlFieldsCar } = this.state;
    if (type !== 'remark') {
      controlFieldsCar[type][prop][boolean] = !this.props.form.getFieldValue(key);
    } else {
      controlFieldsCar[type][boolean] = !this.props.form.getFieldValue(key);
    }
    this.setState({
      controlFieldsCar
    }, this.initTable);
  };
  // 点击行程的预算费用编码Input
  otherInputChange = (e, key, state) => {
    console.log('-----000----', key, this.props.form.getFieldValue(key))
    this.setState({
      [state]: e.target.value
    }, this.initTable);
  };
  // 点击机票火车酒店，其他交通，差旅补贴补贴是否显示的CheckBox
  otherCheckboxChange = (e, key, state) => {
    this.setState({
      [state]: !this.props.form.getFieldValue(key)
    }, this.initTable);
  };
  outCheckboxChange = (value, outIndex) => {
    let { outItineraryList } = this.state;
    outItineraryList[outIndex].isShow = value;
    this.setState({
      outItineraryList
    }, this.initTable);
  };
  //点击保存时调用的函数
   saveTravelForm = () => {
    const {formOID} = this.props.params;
    const {controlFieldsFlight, controlFieldsHotel, controlFieldsOfflineHotel, controlFieldsTrain, costCenterCustom, manageType,
      isTicketShow, isHotelShow, isOfflineHotelShow, isTrainShow, otherTransport, travelAllowances,
      travelDeactivatedate, travelRemark, formManagement, isDidiShow, isDidiTravel, isAirlineShow, isUrbanShow, isWaterShow,
      isDidiDate, isDidiCount, outItineraryList, isCtripInstant, isCtripPickup, isDiningShow, controlFieldsDining,
      controlFieldsCar, promptList, controlFieldsAirline, controlFieldsUrban, controlFieldsWater,
      airlineBudgetExpenseTypeCode, trainBudgetExpenseTypeCode, urbanBudgetExpenseTypeCode, waterBudgetExpenseTypeCode,
      offlineHotelBudgetExpenseTypeCode
    } = this.state;
      this.props.form.validateFieldsAndScroll((err,values) => {
       if (!err) {
         //校验滴滴行程配置
         if (isDidiShow && !isDidiTravel && !isDidiDate && !isDidiCount && !isCtripInstant && !isCtripPickup) {
           message.error(messages('setting.key1494')/*请至少勾选一种用车类型*/);
           return;
         }
         //校验提示语开启必填
         let promptError = false;
         promptList.map(item => {
           if (item.enable && !item.tips) {
             promptError = true;
           }
         });
         if (promptError) {
           message.error(messages('setting.key2234')/*行程提示不能为空*/);
           return;
         }
         //提交前处理数据
         let flightField = JSON.parse(JSON.stringify(controlFieldsFlight));
         let trainField = JSON.parse(JSON.stringify(controlFieldsTrain));
         let hotelField = JSON.parse(JSON.stringify(controlFieldsHotel));
         let offlineHotelField = JSON.parse(JSON.stringify(controlFieldsOfflineHotel));
         let airlineField = JSON.parse(JSON.stringify(controlFieldsAirline));
         let urbanField = JSON.parse(JSON.stringify(controlFieldsUrban));
         let waterField = JSON.parse(JSON.stringify(controlFieldsWater));
         let diningField = JSON.parse(JSON.stringify(controlFieldsDining));
         let carField = JSON.parse(JSON.stringify(controlFieldsCar));
         this.processConfig(flightField);
         this.processConfig(trainField);
         this.processConfig(hotelField);
         this.processConfig(offlineHotelField);
         // this.processConfig(airlineField);
         // this.processConfig(urbanField);
         // this.processConfig(waterField);
         this.processConfig(diningField);
         let params = {
           controlFieldsFlight: JSON.stringify(flightField),
           controlFieldsHotel: JSON.stringify(hotelField),
           controlFieldsOfflineHotel: JSON.stringify(offlineHotelField),
           controlFieldsAirline: JSON.stringify(airlineField),
           controlFieldsUrban: JSON.stringify(urbanField),
           controlFieldsWater: JSON.stringify(waterField),
           controlFieldsTrain: JSON.stringify(trainField),
           controlFieldsDining: JSON.stringify(diningField),
           controlFieldsCar: JSON.stringify(carField),
           costCenterCustom: JSON.stringify(costCenterCustom),
           manageType: JSON.stringify(manageType),
           'ca.travel.flight.disabled': !isTicketShow,
           'hotel.itinerary.enable': isHotelShow,
           'offline.hotel.itinerary.enable': isOfflineHotelShow,
           'airline.itinerary.enable': isAirlineShow,
           'urban.itinerary.enable': isUrbanShow,
           'water.itinerary.enable': isWaterShow,
           'dining.itinerary.enable': isDiningShow,
           'ca.travel.train.disabled': !isTrainShow,
           'ca.travel.other.disabled': !otherTransport,
           'travel.allowance.disabled': !travelAllowances,
           'ca.travel.deactivatedate.enabled': travelDeactivatedate,
           'ca.travel.remark.disabled': !travelRemark,
           'didi.itinerary.enable': isDidiShow,
           'didi.itinerary.enable.types': JSON.stringify({
             TRAVEL: isDidiTravel,
             BUSINESS_TRIP_BY_DATE: isDidiDate,
             BUSINESS_TRIP_BY_TIMES: isDidiCount,
             CARQUICK: isCtripInstant,
             CARPICKUP: isCtripPickup
           }),
           out_itineraries: JSON.stringify(outItineraryList),
           // 'airline.itinerary.budget.expense.type.code': airlineBudgetExpenseTypeCode,
           // 'train.itinerary.budget.expense.type.code': trainBudgetExpenseTypeCode,
           // 'urban.itinerary.budget.expense.type.code': urbanBudgetExpenseTypeCode,
           // 'water.itinerary.budget.expense.type.code': waterBudgetExpenseTypeCode,
           // 'offline.hotel.itinerary.budget.expense.type.code': offlineHotelBudgetExpenseTypeCode,
           airlineBudgetExpenseTypeCode,
           trainBudgetExpenseTypeCode,
           urbanBudgetExpenseTypeCode,
           waterBudgetExpenseTypeCode,
           offlineHotelBudgetExpenseTypeCode
         }
         this.setState({saveLoading: true});

         let propertyList = [];
         let promptConfig = {};
         promptConfig.formOID = formOID;
         promptConfig.propertyName = 'travel.itinerary.tips';
         promptConfig.propertyValue = JSON.stringify(promptList);
         propertyList.push(promptConfig);

         let serviceArray = [];
         serviceArray.push(formService.saveSupplierForm(formOID, params));
         serviceArray.push(formService.saveFormProperty(propertyList));
         Promise.all(serviceArray).then(res => {
           this.setState({saveLoading: false});
           if (res[0].status === 200) {
             message.success(messages('setting.key211'/*保存成功*/));
             this.setState({
               disabled: true,
               isEditing: false,
             })
             this.props.saveHandle(true)
           } else {
             message.error(messages('setting.key212'/*保存失败*/))
           }
         }).catch(err => {
           this.setState({saveLoading: false});
           errorMessage(err.response);
         });
       }
    })
  }

  //提交前处理数据，维护enable字段
  processConfig = (fields) => {
    let key = '';
    for (key in fields) {
      if (key !== 'preBookingDays') {
        //有一个为false时enable字段就为false
        if (fields[key].control && fields[key].show && fields[key].required) {
          fields[key].enable = true;
        } else {
          fields[key].enable = false;
        }
      }
    }
    if (fields.hasOwnProperty('departEndDate')) {
      fields['departEndDate'].enable = fields['departBeginDate'].enable;
      fields['departEndDate'].show = fields['departBeginDate'].show;
      fields['departEndDate'].required = fields['departBeginDate'].required;
      fields['departEndDate'].control = fields['departBeginDate'].control;
    }
    if (fields.hasOwnProperty('returnBeginDate')) {
      fields['returnBeginDate'].enable = fields['returnEndDate'].enable;
      fields['returnBeginDate'].show = fields['returnEndDate'].show;
      fields['returnBeginDate'].required = fields['returnEndDate'].required;
      fields['returnBeginDate'].control = fields['returnEndDate'].control;
    }
  };

  showAddOutItinerary = (index) => {
    this.setState({showOutModal: true, selectedOutIndex: index !== undefined ? index : -1});
  };

  renderFooter = () => {
    return (
      <div className='default-color-font'>
        <span style={{display: 'inline-block', cursor: 'pointer'}} onClick={() => this.showAddOutItinerary()}>
          <Icon type="plus" />&nbsp; {messages('setting.key1898')/*添加外部行程*/}
        </span>
        &nbsp;
        <Tooltip title={messages('setting.key1899')/*添加外部行程后，要达到可使用状态，还需配合接口配置。*/}>
          <Icon type="info-circle" />
        </Tooltip>
      </div>
    )
  };

  handleOutModalCancel = () => {
    this.setState({showOutModal: false});
  };

  handleOutModalOk = (data, selectedIndex) => {
    let { outItineraryList } = this.state;
    this.setState({showOutModal: false});
    if (selectedIndex > -1) {
      outItineraryList.splice(selectedIndex, 1, data);
    } else {
      outItineraryList.push(data);
    }
    this.setState({
      outItineraryList
    }, () => {
      this.initTable();
    });
  };

  handleDeleOut = (index) => {
    let { outItineraryList } = this.state;
    outItineraryList.splice(index, 1);
    this.setState({
      outItineraryList
    }, () => {
      this.initTable();
    });
  };

  handleChangeItineraryPrompt = (value) => {
    this.setState({promptList: value});
  };

  render(){
    const { columns, data, formManagement, isEditing, showOutModal, selectedOutIndex, outItineraryList, saveLoading, promptList } = this.state;
    const { disabled: hiding } = this.props;
    return(
      <div className='form-setting-travel'>
        <div className='travel-alert'>
          <Alert
            message={messages("common.help")/*帮助提示*/}
            description={(
              <div>
                {messages('setting.key2119')/*设置申请单中需要开启的功能类型，以及功能类型的自定义内容。*/}
              </div>
            )}
            type="info"
            showIcon/>
        </div>
        <Form hideRequiredMark={true}>
        <ResizeTable rowKey='key' dataSource={data} columns={columns} bordered footer={isEditing ? () => this.renderFooter() : undefined} pagination={false}/>
        </Form>
        <ItineraryPrompt promptList={promptList} onChange={this.handleChangeItineraryPrompt} disabled={!isEditing} />
        {!hiding && (
          <div className='form-setting-buttons bottom-bar'>
            {isEditing ?
              <div>
                <Button type='primary' className='buttons-save' loading={saveLoading} onClick={this.saveTravelForm}>{messages("common.save")/*保存*/}</Button>
                <Button type='primary' className='buttons-cancelEdit' onClick={this.cancelEditing}>{messages('setting.key667'/*取消编辑*/)}</Button>
                <Button type='default' onClick={() => {
                  this.context.router.push(formManagement.url);
                }}>{messages("common.back")/*返回*/}</Button>
              </div>
              :
              <div>
                <Button type='primary' className='buttons-edit' onClick={this.editClicked}>{messages("common.edit")/*编辑*/}</Button>
                <Button type='default' onClick={() => {
                  this.context.router.push(formManagement.url);
                }}>{messages("common.back")/*返回*/}</Button>
              </div>
            }
          </div>
        )}
        <OutItinerary visible={showOutModal}
                      onCancel={this.handleOutModalCancel}
                      onOk={this.handleOutModalOk}
                      outList={outItineraryList}
                      selectedIndex={selectedOutIndex}
        />
      </div>
    )
  }
}

TravelItinerarySetting.contextTypes = {
  router: React.PropTypes.object
};
function mapStateToProps(state) {
  return {}
}
const wrappedNewContract = Form.create()(TravelItinerarySetting);
export default connect(mapStateToProps)(wrappedNewContract);
